import mod_item

class LevelPortSteppedOnEffect:
    def doIt(self,actor,levelPort):
        mod_gui.theGUI.messages.append(actor.glyph+' STEPS ON LEVEL TELEPORTER!')
        oldLevel = actor.location[0]
        if oldLevel.number == 1:
            newLevel = self.location[0].game.getLevel(2)
            newLevel.addPlayer(actor)
        elif oldLevel.number == 2:
            newLevel = self.location[0].game.getLevel(1)
            newLevel.addPlayer(actor)

levelJumpPrototype = mod_item.ItemPrototype('LEVELPORTAL',grabbable=False)

